package com.xu.sso.server.service.convert;

import com.xu.sso.server.model.request.ApiLoginRequest;
import com.xu.sso.server.model.request.LoginRequest;
import com.xu.sso.server.model.response.ApiLoginResponse;
import com.xu.sso.server.model.response.LoginResponse;

public class ApiLoginConvert {

    public static LoginRequest convert(ApiLoginRequest request) {
        LoginRequest loginRequest = new LoginRequest();
        loginRequest.setAppId(request.getAppId());
        loginRequest.setUsername(request.getUsername());
        loginRequest.setPassword(request.getPassword());
        return loginRequest;
    }

    public static ApiLoginResponse convert(LoginResponse response) {
        ApiLoginResponse loginResponse = new ApiLoginResponse();
        loginResponse.setToken(response.getToken());
        return loginResponse;
    }

}
